This notebook investigates the alexnet-based model with 8-augmentation with an extra convolutional layer with 192 output channels (as in the original paper by Krizhevsky et al).
When training the model, we saved both files from the best and most recent epoch. First plot the most recent file, to see the evolution of parameters.
In [1]:
import pylearn2.utils
import pylearn2.config
import theano
import neukrill_net.dense_dataset
import neukrill_net.utils
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import holoviews as hl
%load_ext holoviews.ipython
import sklearn.metrics
In [57]:
m = pylearn2.utils.serial.load(
"/disk/scratch/neuroglycerin/models/alexnet_based_extra_convlayer.pkl.recent")
In [58]:
channel = m.monitor.channels["valid_objective"]
hl.Curve(zip(channel.example_record,channel.val_record),label="valid_objective")
Out[58]:
In [59]:
plt.plot(channel.example_record,channel.val_record)
Out[59]:
In [60]:
def make_curves(model, *args):
curves = None
for c in args:
channel = m.monitor.channels[c]
c = c[0].upper() + c[1:]
if not curves:
curves = hl.Curve(zip(channel.example_record,channel.val_record),group=c)
else:
curves += hl.Curve(zip(channel.example_record,channel.val_record),group=c)
return curves
In [61]:
make_curves(m,"valid_objective","valid_y_nll","train_y_nll")
Out[61]:
The graph keeps going down for the train_y_nll
while it is sort of stable and slightly sloping upwards for valid_y_nll
and valid_objective
. We think it suggests that we are overfitting.
Let's now see the best parameter values.
In [49]:
m = pylearn2.utils.serial.load(
"/disk/scratch/neuroglycerin/models/alexnet_based_extra_convlayer.pkl")
Holoviews appears to be letting me down below. The plot for Train_y_nll
appears to show it going down to zero due to it cutting off the bottom of the y axis...
In [50]:
make_curves(m,"valid_y_nll","valid_objective","train_y_nll")
Out[50]:
In [63]:
4000000./(8*30000)
Out[63]:
In [64]:
7*16
Out[64]:
The scale of the graphs is 10^6 not 10^7, so supposedly this is the best value of valid_objective
before we started overfitting.
Let's now see what score we get with the best parameter values from this model.
In [5]:
cd ..
In [6]:
%run check_test_score.py -v run_settings/alexnet_based_extra_convlayer.json
Looks like a better score than the current best! Let's submit it to the leaderboard. Write a submisstion file:
In [8]:
!python test.py -v run_settings/alexnet_based_extra_convlayer.json
Copy the file to your local machine:
In [ ]:
scp s1320903@stonesoup:/disk/scratch/neuroglycerin/submissions/alexnet_based_extra_convlayer.csv.gz /home/aselega/Neuroglycerin/submissions/
And now we are ready to submit it.